package com.quectel.core.module.propertybill.dto;

import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import org.springframework.format.annotation.DateTimeFormat;

import java.io.Serializable;
import java.util.Date;

/**
 * @author bob
 * @email bob.yu@quectel.com
 * @date 2023/03/31 14:36
 */
@Data
@Schema
public class PropertyChargeableListActivityDto implements Serializable {

    /**
     * id
     */
    @Schema(description = "id")
    private Long id;

    /**
     * 租户id
     */
    @Schema(description = "租户id")
    private Long tenantId;

    /**
     * 小区id
     */
    @Schema(description = "小区id")
    private Long villageId;

    @Schema(description = "优惠活动名称")
    private String name;

    /**
     * 收费标准id
     */
    @Schema(description = "收费标准id")
    private Long chargeableListId;

    /**
     * 优惠周期
     */
    @Schema(description = "优惠周期")
    private Integer year;

    @Schema(description = "周期")
    private Byte period;

    /**
     * 周期对应时段，对于月[1,2,12],对于季度[1,2]对于半年[1,2]对于年这个地方不需要存入
     */
    @Schema(description = "周期对应时段，对于月[1,2,12],对于季度[1,2]对于半年[1,2]对于年这个地方不需要存入")
    private String timeArr;

    /**
     * 优惠内容json；type1金额或者折扣优惠， type2赠送月份 type3送礼品 [{"type":1,"arrs":[{"configid":"xxxx","discountType":1,"discount":80},{"configid":"xxxx","discountType":1,"discount":80},{"configid":"xxxx","discountType":1,"discount":80}]},{"type":2,"month":12},{"type":3,"arrs":[{"productName":"礼品1","price":80},{"productName":"礼品2","price":120}]}]
     */
    @Schema(description = "优惠内容json")
    private String discountConfigs;

    /**
     * 赠送月数
     */
    @Schema(description = "赠送月数")
    private Integer giveMonths;

    /**
     * 优惠开始时间
     */
    @Schema(description = "优惠开始时间")
    @DateTimeFormat(pattern = "yyyy-MM-dd")
    @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
    private Date startDate;

    /**
     * 优惠结束时间
     */
    @Schema(description = "优惠结束时间")
    @DateTimeFormat(pattern = "yyyy-MM-dd")
    @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
    private Date endDate;

    /**
     * 状态： 0.禁用 1.启用
     */
    @Schema(description = "状态： 0.禁用 1.启用")
    private Byte status;

    /**
     * 创建人
     */
    @Schema(description = "创建人")
    private String creator;

    /**
     * 创建时间
     */
    @Schema(description = "创建时间")
    private Date createTime;

    /**
     * 修改人
     */
    @Schema(description = "修改人")
    private String editor;

    /**
     * 修改时间
     */
    @Schema(description = "修改时间")
    private Date editTime;

    /************非数据库字段 start ************/
    @Schema(description = "小区名称")
    private String villageName;

    @Schema(description = "物业缴费标准名称")
    private String chargeableListName;

    @Schema(description = "周期名称拼接")
    private String periodTimeArrString;
    /************非数据库字段 end **************/
}
